home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / Unmangler.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  2.2 KB  |  50 lines  |  [TEXT/MPS ]

  1. (*---------------------------------------------------------------------------*
  2.  |                                                                           |
  3.  |                            <<< Unmangler.p >>>                            |
  4.  |                                                                           |
  5.  |                         C++ Function Name Decoding                        |
  6.  |                                                                           |
  7.  |                 Copyright Apple Computer, Inc. 1988-1991                  |
  8.  |                           All rights reserved.                            |
  9.  |                                                                           |
  10.  *---------------------------------------------------------------------------*)
  11.  
  12. UNIT Unmangler;
  13.  
  14.     INTERFACE
  15.         
  16.         USES Types;
  17.  
  18.         (*
  19.         FUNCTION unmangle(dst: UNIV Ptr; src: UNIV Ptr; limit: LongInt): LongInt; C;
  20.             {This function unmangles C++ mangled symbols (i.e. a symbol with a type signature).
  21.              The mangled C string is passed in “src” and the unmangled C string is returned in
  22.              “dst”.  Up to “limit” characters (not including terminating null) may be retured
  23.              in “dst”.
  24.          
  25.              The function returns,
  26.          
  27.                  -1 ==> error, probably because symbol was not mangled, but looked like it was
  28.                     0 ==> symbol wasn't mangled; not copied either
  29.                     1 ==> symbol was mangled; unmangled result fit in buffer
  30.                     2 ==> symbol was mangled; unmangled result truncated to fit in buffer}
  31.         *)
  32.         
  33.         FUNCTION Unmangle(dst: UNIV StringPtr; src: UNIV StringPtr; limit: LongInt): LongInt;
  34.             {This function unmangles C++ mangled symbols (i.e. a symbol with a type signature).
  35.              The mangled Pascal string is passed in “src” and the unmangled Pascal string is
  36.              returned in “dst”.  Up to “limit” characters may be retured in “dst”.
  37.             
  38.              The function returns,
  39.              
  40.                  -1 ==> error, probably because symbol was not mangled, but looked like it was
  41.                     0 ==> symbol wasn't mangled; not copied either
  42.                     1 ==> symbol was mangled; unmangled result fit in buffer
  43.                     2 ==> symbol was mangled; unmangled result truncated to fit in buffer
  44.                      
  45.              This function is identical to unmangle() above except that all the strings are
  46.              Pascal instead of C strings.
  47.             }
  48.  
  49. END.
  50.